<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:a4j="http://richfaces.org/a4j"
    xmlns:rich="http://richfaces.org/rich">

<ui:composition template="templates/template.xhtml">

	<ui:define name="title">
	 	<h:outputText value="Search Page"/>
	</ui:define>
	
	<ui:param name="page" value="home" />
	
	<ui:define name="header">
		<ui:include src="header.xhtml" />
	</ui:define>
	
		<ui:define name="menu">
		
		<f:loadBundle basename="us.gaaoc.framework.webapp.util.userMessage" var="bundle" />
		<h:form id="menu">

			<div align="center">
				<br/>
				<br/>
				<h:commandButton value="Back"
					action="#{searchPage.back}"
					styleClass="buttonClass"
					immediate="true" />
				<br/>
				<br/>
				<hr/>
				<br/>
				<h:outputLabel value="Enter OCSS Number:"
					styleClass="fontsubhead"/> 
				<h:inputText id="OCSSNumber"
					value="#{searchPage.externalCaseRecordNumber}" title="#{bundle.oCSSNumberInputText}"/> 
				<h:message for="OCSSNumber"
					styleClass="error" />
				<br/>
				<table>
					<tr>
						<td>
							<h:commandButton for="OCSSNumber"
								value="View Case Filings"
								action="#{searchPage.retrieveFilingsForExternalCaseNumber}" title="#{bundle.oCSSNumberButton}"/>
						</td>
						<td> 
							<h:commandButton for="OCSSNumber"
								value="Reset"
								action="#{searchPage.resetFilingsForExternalCaseNumber}" title="#{bundle.resetButton}"/>
						</td>
					</tr> 
				</table>
				<br/>
				<hr/>
				<br/>
				<h:outputLabel value="Enter Civil Action Number:"
					styleClass="fontsubhead"/> 
				<h:inputText id="CivilActionNumber"
					value="#{searchPage.docketId}" title="#{bundle.civilActionNumberInputText}"/> 
				<h:message for="CivilActionNumber"
					styleClass="error"/> 
				<br/>
				<table>
					<tr>
						<td>
							<h:commandButton for="CivilActionNumber"
								value="View Case Filing"
								action="#{searchPage.retrieveFilingForCivilActionNumber}" title="#{bundle.civilActionNumberButton}"/>
						</td>
						<td>
							<h:commandButton for="CivilActionNumber"
								value="Reset"
								action="#{searchPage.resetFilingForCivilActionNumber}" title="#{bundle.resetButton}" />
						</td>
					</tr>
				</table>
				<br/>
					<h:selectBooleanCheckbox id="extendedSearch"
						title = "Extended Search"
						required="false"
						immediate="true" 
						value="#{searchPage.extendedSearch}"/>
					<h:outputText value = "Extended Search" />
					<h:outputText value = " -- Search Within Court Case Management System" />
				<br/>
				<br/>		
				<hr/>
				<br/>
				<h:outputLabel value="Enter Person Name"
					styleClass="fontsubhead"/> 
			<table>
				<tr>
					<td>
						<h:outputText value="First Name" />
					</td>
					<td>
						<h:inputText id="firstName"
							value="#{searchPage.firstName}" />
					</td>
				</tr>
			</table>
			<h:message for="firstName" styleClass="error" /> 
			<table>
				<tr>
			 		<td>
			 			<h:outputText value="Middle Name" />
			 		</td>
			 		<td> 
						<h:inputText id="middleName"
							value="#{searchPage.middleName}" />
					</td>
				</tr>
			</table> 
			<h:message for="middleName" styleClass="error" />
			<table>
				<tr>
					<td>
						<h:outputText value="Last Name" />
					</td>
					<td> 
						<h:inputText id="lastName"
							value="#{searchPage.lastName}" />
					</td>
				</tr>
			</table>
			<h:message for="lastName" styleClass="error" /> 
			<table>
			<tr>
				<td>
					<h:selectBooleanCheckbox id="defendantSearch"
						value="#{searchPage.defendantFilter}"/>
				</td>
				<td>
					<h:outputText value="Search Defendants Only"/>
				</td>
			</tr>
			</table>
			<table>
				<tr>
					<td>
						<h:commandButton value="View Filings" action="#{searchPage.retrieveFilingsForName}"  title="#{bundle.partiesButton}"/>
					</td>
					<td>
						<h:commandButton value="Reset" action="#{searchPage.resetFilingsForName}" title="#{bundle.resetButton}" />
					</td>
				</tr>
			</table>
			<br/>
			<hr/>
			<br/>
			<h:outputLabel value = "Filing Activities"
				styleClass="fontsubhead" />
			<br/>
			<h:panelGroup>
				<h:outputLabel value="Starting Date: "/>
				<h:panelGroup>
			 		<t:inputCalendar id="startingDate" 
						monthYearRowClass="yearMonthHeader"
						weekRowClass="weekHeader" 
						currentDayCellClass="currentDayCell"
						value="#{searchPage.startingDate}"
						renderAsPopup="true"
						renderPopupButtonAsImage="true"/>     
				 	</h:panelGroup>
			</h:panelGroup>
			<br/>
			<h:panelGroup>
				<h:outputLabel value="Ending Date: "/>
				<h:panelGroup>
		 			<t:inputCalendar id="endingDate" 
				  		monthYearRowClass="yearMonthHeader"
						weekRowClass="weekHeader" 
						currentDayCellClass="currentDayCell"
						value="#{searchPage.endingDate}"
						renderAsPopup="true"
						renderPopupButtonAsImage="true"/>     
			 		</h:panelGroup>
				</h:panelGroup>
				<br/>
				<br/>
				<table>
					<tr>
						<td>
							<h:commandButton value="View Filings Status"
								action="#{searchPage.retrieveFilingsInitiatedPastDays}" title="#{bundle.viewStatusButton}"/>
						</td>
						<td>
							<h:commandButton value="Reset"
								action="#{searchPage.resetFilingsInitiatedPastDays}"  title="#{bundle.resetButton}"/>
						</td>
					</tr>
				</table>	
			</div>
		</h:form>
	</ui:define>
	
	<ui:define name="body">
		<h:form>

			
				
			<h:panelGrid rendered="#{searchPage.displayNoFilingsMessage}"
				columns="1"
				width="80%"
				styleClass="outerTable"
				columnClasses="standardTable_ColumnCentered">
					<f:facet name="header">
						<h:outputText value="There are no Filings" />
					</f:facet>
			</h:panelGrid>

			<h:panelGrid
				rendered="#{searchPage.displayFililngsForExternalCaseRecordNumberTable}"
				columns="1"
				width="80%"
				styleClass="outerTable"
				columnClasses="standardTable_ColumnCentered">
					<f:facet name="header">
						<h:outputText
							value="Status Table of Filings for an OCSS Case Number " />
					</f:facet>
				<h:column>
					<t:dataTable renderedIfEmpty="false"  id="filingsForOCSSNumber"
						value="#{searchPage.filingsForExternalCaseNumberList}"
						var="filing"
						styleClass="iCubed"
						width="100%"
						rows="10"
						rowIndexVar="index">
						<h:column>
							<f:facet name="header">
								<h:outputText id="instatiationTime"
									value="Initiated Date" />
							</f:facet>
							<h:outputText value="#{filing.instantiationDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="defendantName"
									value="Defendant Name" />
							</f:facet>
							<h:outputText value="#{filing.defendantName}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseType" value="Case Type" />
							</f:facet>
							<h:outputText value="#{filing.caseType}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseStatus" value="Case Status" />
							</f:facet>
							<h:outputText value="#{filing.status}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="lastEvent" value="Last Event" />
							</f:facet>
							<h:outputText value="#{filing.eventType}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="lastEventTime" value="Last Event Time" />
							</f:facet>
							<h:outputText value="#{filing.eventDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="filingID" value="Case Details" />
							</f:facet>
							<h:commandLink value="Case Details"
								action="#{searchPage.gotoCaseDetailsPage}">
								<f:param name="case1" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>
						<h:column rendered="#{searchPage.displayClearButton}">
							<f:facet name="header">
								<h:outputText id="clear" value="Clear" />
							</f:facet>
							<h:commandLink rendered="#{searchPage.displayClearButton}" value="clear" action="#{searchPage.clear}">
								<f:param name="case2" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>

					</t:dataTable>
				</h:column>

				<h:column>
					<div align="center"><t:dataScroller fastStep="5"
						styleClass="scrollerTable" pageCountVar="pageCount"
						pageIndexVar="pageIndex" paginator="true" paginatorMaxPages="10"
						paginatorTableClass="paginator"
						paginatorActiveColumnStyle="font-weight:bold;" immediate="false"
						for="filingsForOCSSNumber">
						<f:facet name="first">
							<t:graphicImage url="/images/arrow-first.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="last">
							<t:graphicImage url="/images/arrow-last.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="previous">
							<t:graphicImage url="/images/arrow-previous.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="next">
							<t:graphicImage url="/images/arrow-next.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastforward">
							<t:graphicImage url="/images/arrow-ff.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastrewind">
							<t:graphicImage url="/images/arrow-fr.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
					</t:dataScroller></div>
				</h:column>
			</h:panelGrid>


			<h:panelGrid
				rendered="#{searchPage.displayFilingForCivilActionNumber}"
				columns="1" width="80%" styleClass="outerTable"
				columnClasses="standardTable_ColumnCentered">
				<f:facet name="header">
					<h:outputText
						value="Status Table of Filing for Civil Action Number " />
				</f:facet>
				<h:column>
					<t:dataTable renderedIfEmpty="false"  id="filingForCivilActionNumber"
						value="#{searchPage.filingForCivilActionNumber}" var="filing"
						styleClass="iCubed" width="100%" rows="10" rowIndexVar="index">

						<h:column>
							<f:facet name="header">
								<h:outputText id="instantiationTime" value="Initiated Date" />
							</f:facet>
							<h:outputText value="#{filing.instantiationDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="defendantName" value="Defendant Name" />
							</f:facet>
							<h:outputText value="#{filing.defendantName}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseType" value="Case Type" />
							</f:facet>
							<h:outputText value="#{filing.caseType}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseStatus" value="Case Status" />
							</f:facet>
							<h:outputText value="#{filing.status}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="lastEvent" value="Last Event" />
							</f:facet>
							<h:outputText value="#{filing.eventType}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="lastEventTime" value="Last Event Time" />
							</f:facet>
							<h:outputText value="#{filing.eventDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="filingID" value="Case Details" />
							</f:facet>
							<h:commandLink value="Case Details"
								action="#{searchPage.gotoCaseDetailsPage}">
								<f:param name="case1" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>
						 <h:column rendered="#{searchPage.displayClearButton}">
							<f:facet name="header">
								<h:outputText id="clear" value="Clear" />
							</f:facet>
							<h:commandLink rendered="#{searchPage.displayClearButton}" value="clear" action="#{searchPage.clear}">
								<f:param name="case2" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>
						 
					</t:dataTable>
				</h:column>

				<h:column>
					<div align="center"><t:dataScroller fastStep="5"
						styleClass="scrollerTable" pageCountVar="pageCount"
						pageIndexVar="pageIndex" paginator="true" paginatorMaxPages="10"
						paginatorTableClass="paginator"
						paginatorActiveColumnStyle="font-weight:bold;" immediate="false"
						for="filingForCivilActionNumber">
						<f:facet name="first">
							<t:graphicImage url="/images/arrow-first.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="last">
							<t:graphicImage url="/images/arrow-last.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="previous">
							<t:graphicImage url="/images/arrow-previous.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="next">
							<t:graphicImage url="/images/arrow-next.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastforward">
							<t:graphicImage url="/images/arrow-ff.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastrewind">
							<t:graphicImage url="/images/arrow-fr.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
					</t:dataScroller></div>
				</h:column>
			</h:panelGrid>

			<h:panelGrid rendered="#{searchPage.displayFilingsForName}"
				columns="1" width="80%" styleClass="outerTable"
				columnClasses="standardTable_ColumnCentered">
				<f:facet name="header">
					<h:outputText value="Status Table of Filing for Person Search " />
				</f:facet>
				<h:column>
					<t:dataTable renderedIfEmpty="false"  id="filingsForName"
						value="#{searchPage.filingsForName}" var="filing"
						styleClass="iCubed" width="100%" rows="10" rowIndexVar="index">

						<h:column>
							<f:facet name="header">
								<h:outputText id="instatiationTime" value="Initiated Date" />
							</f:facet>
							<h:outputText value="#{filing.instantiationDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="defendantName" value="Person Name Searched" />
							</f:facet>
							<h:outputText value="#{filing.defendantName}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseType" value="Case Type" />
							</f:facet>
							<h:outputText value="#{filing.caseType}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseStatus" value="Case Status" />
							</f:facet>
							<h:outputText value="#{filing.status}" />
						</h:column>						
						<h:column >
							<f:facet name="header">
							 <h:outputText id="lastEvent" value="Last Event" />
							</f:facet>
							<h:commandLink value="#{filing.eventType}"
								action="#{searchPage.gotoHistoryPage}">
								<f:param name="case3" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
							 
							</h:column >
						<h:column>
							<f:facet name="header">
								<h:outputText id="lastEventTime" value="Last Event Time" />
							</f:facet>
							<h:outputText value="#{filing.eventDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="filingID" value="Case Details" />
							</f:facet>
							<h:commandLink value="Case Details"
								action="#{searchPage.gotoCaseDetailsPage}">
								<f:param name="case1" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>
						 <h:column rendered="#{searchPage.displayClearButton}">
							<f:facet name="header">
								<h:outputText id="clear" value="Clear" />
							</f:facet>
							<h:commandLink rendered="#{searchPage.displayClearButton}" value="clear" action="#{searchPage.clear}">
								<f:param name="case2" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>
						
					</t:dataTable>
				</h:column>

				<h:column>
					<div align="center"><t:dataScroller fastStep="5"
						styleClass="scrollerTable" pageCountVar="pageCount"
						pageIndexVar="pageIndex" paginator="true" paginatorMaxPages="10"
						paginatorTableClass="paginator"
						paginatorActiveColumnStyle="font-weight:bold;" immediate="false"
						for="filingsForName">
						<f:facet name="first">
							<t:graphicImage url="/images/arrow-first.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="last">
							<t:graphicImage url="/images/arrow-last.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="previous">
							<t:graphicImage url="/images/arrow-previous.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="next">
							<t:graphicImage url="/images/arrow-next.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastforward">
							<t:graphicImage url="/images/arrow-ff.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastrewind">
							<t:graphicImage url="/images/arrow-fr.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
					</t:dataScroller></div>
				</h:column>
			</h:panelGrid>
			
			<h:panelGrid rendered="#{searchPage.displayFilingsForPastDays}"
				columns="1" width="80%" styleClass="outerTable"
				columnClasses="standardTable_ColumnCentered">
				<f:facet name="header">
					<h:outputText value="Status Table of Filings for Past Days  " />
				</f:facet>
				<h:column>
					<t:dataTable renderedIfEmpty="false"  id="filingsForPastDays"
						value="#{searchPage.filingsForPastDays}" var="filing"
						styleClass="iCubed" width="100%" rows="10" rowIndexVar="index">

						<h:column>
							<f:facet name="header">
								<h:outputText id="instatiationTime" value="Initiated Date" />
							</f:facet>
							<h:outputText value="#{filing.instantiationDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="defendantName" value="Defendant Name" />
							</f:facet>
							<h:outputText value="#{filing.defendantName}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseType" value="Case Type" />
							</f:facet>
							<h:outputText value="#{filing.caseType}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="caseStatus" value="Case Status" />
							</f:facet>
							<h:outputText value="#{filing.status}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="lastEvent" value="Last Event" />
							</f:facet>
							<h:outputText value="#{filing.eventType}" />
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="lastEventTime" value="Last Event Time" />
							</f:facet>
							<h:outputText value="#{filing.eventDateTime}">
								<f:convertDateTime 
									dateStyle="medium"
									timeZone="America/New_York" 
									type="date"/>
							</h:outputText>
						</h:column>
						<h:column>
							<f:facet name="header">
								<h:outputText id="filingID" value="Case Details" />
							</f:facet>
							<h:commandLink value="Case Details"
								action="#{searchPage.gotoCaseDetailsPage}">
								<f:param name="case1" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>
						 <h:column rendered="#{searchPage.displayClearButton}">
							<f:facet name="header">
								<h:outputText id="clear" value="Clear" />
							</f:facet>
							<h:commandLink rendered="#{searchPage.displayClearButton}" value="clear" action="#{searchPage.clear}">
								<f:param name="case2" value="#{filing}"
									binding="#{searchPage.parameterLinkToCaseDetails}" />
							</h:commandLink>
						</h:column>
						 
					</t:dataTable>
				</h:column>

				<h:column>
					<div align="center"><t:dataScroller fastStep="5"
						styleClass="scrollerTable" pageCountVar="pageCount"
						pageIndexVar="pageIndex" paginator="true" paginatorMaxPages="10"
						paginatorTableClass="paginator"
						paginatorActiveColumnStyle="font-weight:bold;" immediate="false"
						for="filingsForName">
						<f:facet name="first">
							<t:graphicImage url="/images/arrow-first.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="last">
							<t:graphicImage url="/images/arrow-last.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="previous">
							<t:graphicImage url="/images/arrow-previous.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="next">
							<t:graphicImage url="/images/arrow-next.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastforward">
							<t:graphicImage url="/images/arrow-ff.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
						<f:facet name="fastrewind">
							<t:graphicImage url="/images/arrow-fr.gif" border="1"
								styleClass="objectList_GraphicImage" />
						</f:facet>
					</t:dataScroller></div>
				</h:column>
			</h:panelGrid>
			
		</h:form>
	</ui:define>

</ui:composition>
</html>
